package cn.demo.dao.impl;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import cn.demo.dao.UserDao;

public class Test {
	public static void main(String[] args) {
		// 加载Spring配置文件,构建在配置文件中声明的对象
		ApplicationContext context = new ClassPathXmlApplicationContext(
				"applicationContext.xml");
		UserDao uDao = (UserDao) context.getBean("userDao");
		System.out.println(uDao.query());
	}
}
